﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TarreOA.TarreOAModels;
using TarreOA.TarreOABLL;

public partial class Flow_Info_TransactWorkData : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        if(Request.Form.Get("max") != null && Request.Form.Get("WR_ID") != null && Request.Form.Get("ST_SO") != null) {
            int work_id = int.Parse(Request.Form.Get("WR_ID"));
            int step_sort = int.Parse(Request.Form.Get("ST_SO"));
            int max = int.Parse(Request.Form.Get("max"));
            string sql = "";
            for(int i = 0; i < max; i++) {
                string data = Request.Form.Get("DATA_" + i) == null ? "" : Request.Form.Get("DATA_" + i);
                sql += " update Flow_WorkProcessData set Att_Content = '" + data + "' where New_Work_Id = " + +work_id + " and Data_Sort_Id = " + (i + 1);
            }
            if(!"".Equals(sql)) {
                Flow_WorkProcessData_Service fwpd_service = new Flow_WorkProcessData_Service();
                fwpd_service.SaveProcessData(sql);
                ScriptManager.RegisterClientScriptBlock(Page, GetType(), "", "parent.location='WillTransactWork.aspx';", true);
            }
        }
    }
}
